<% layout('/layouts/default.html', {title: '批示页面', libs: ['validate','fileupload']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-body" style="height: 352px;">
			<div class="col-xs-12" style="margin-bottom: 18px;">
				<#form:textarea path="explainContent" rows="4" maxlength="1000" class="form-control" placeholder="请在此处输入批示"/>

			</div>
			<div class="row" style="text-align: right;">
				<div class="col-sm-offset-2 col-sm-10">
					<button type="submit" class="btn btn-sm btn-primary" id="btnSubmit"><i class="fa fa-check"></i> ${text('提 交')}</button>&nbsp;
					<button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="js.closeCurrentTabPage()"><i class="fa fa-reply-all"></i> ${text('关 闭')}</button>
				</div>
			</div>
			<div id="explainContentList" class="col-xs-12">

			</div>
		<p></p>

		</div>
		<div class="box-footer">

		</div>
</div>
</div>
<% } %>
<script>

	$(function () {
		$.ajax({
			url: "${ctx}/home/homePage/explainData",
			type: "post",
			cache: false,
			async:false,
			data: {
				"actionId":"${dcSupTaskActionExplain.actionId}"
			},
			success: function(res) {
				$.each(res, function (index, item) {
					$("#explainContentList").append(item.explainTime+" "+item.explainName+" <div class=\"control-label \" style=\"text-align: left;overflow:auto; white-space: pre-line;\">" + item.explainContent + "</div>")
				})}
		})


	})

		$("#btnSubmit").click(
				function () {
				var explainContent =	$("#explainContent").val()
					if(explainContent){
						$.ajax({
							url: "${ctx}/home/homePage/save",
							type: "post",
							cache: false,
							async:false,
							data: {
								"actionId":"${dcSupTaskActionExplain.actionId}",
								"explainCode":"${@UserUtils.getUser().getUserCode()}",
								"explainContent":explainContent
							},
							success: function(res){
								location.reload();
							}
						});
					}



				}
		)


</script>